import React from 'react';
import ReactDOM from 'react-dom';
import Notification from 'rc-notification';
import 'rc-notification/assets/index.css';

const notification = Notification.newInstance({
  style : {
    top: '.2rem',
    left: '50%'
  }
});

export default class Message{
  static info(content) {
    notification.notice({
      content: content,
      key: '1',
      onClose() {
        console.log('simple close')
      }
    })
  }
  static success(content) {
    notification.notice({
      content: content,
      key: '2',
      onClose() {
        console.log('simple close')
      }
    })
  }
  static error(content) {
    notification.notice({
      content: <span>{content}</span>,
      onClose() {
        console.log('simple close')
      }
    })
  }
  static warn(content) {
    notification.notice({
      content: <span>{content}</span>,
      onClose() {
        console.log('simple close')
      }
    })
  }
  static loading(content) {
    notification.notice({
      content: <span>{content}</span>,
      onClose() {
        console.log('simple close')
      }
    })
  }
  static close(content) {
    notification.notice({
      content: <span>{content}</span>,
      duration: null,
      onClose() {
        console.log('closable close');
      },
      closable: true,
    });
  }
}
